home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / callback.001 / callback~ / callback / login / validate.c < prev   
C/C++ Source or Header  |  1996-07-21  |  617b  |  25 lines

  1.  
  2. #include "cblogin.h"
  3.  
  4. unsigned validate (char *username)
  5. {
  6.     unsigned
  7.         uid;
  8.  
  9.     if ((uid = lookuser(username)) > lastuser())
  10.     {
  11.     puts("No permission.");
  12.     log(log_default, "Illegal attempt by '%s' to use callback", username);
  13.         enable_state();                     /* reset to ok to dial-in */
  14.     exit (1);
  15.     }
  16.  
  17.                                             /* something must be showable */
  18.     if (givedestinations() || givedirect() || giveextra())    
  19.         printf("%s cleared for callback.\n"    
  20.     "Please select a callback destination from the following list:\n", 
  21.     username);
  22.  
  23.     return (uid);
  24. }
  25.